home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
SNIP9_91.ARJ
/
STRREV.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-12
|
349b
|
21 lines
/*
** STRREV.C - reverse a string in place
**
** public domain by Bob Stout
*/
#include <string.h>
char *strrev(char *str)
{
char *p1, *p2;
for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2)
{
*p1 ^= *p2;
*p2 ^= *p1;
*p1 ^= *p2;
}
return str;
}